import java.util.HashMap;
import java.util.Map;

/**
 * @author sky
 * @version 1.0
 * @since 2021/4/11 20:09
 */

public class Auth0Main {
    public static void main(String[] args) throws Exception {
        Map<String, String> claims = new HashMap<>();
        claims.put("id", "aaaa");
        String token = JwtUtils.createToken(claims);
        System.out.println(token);
        String day1 = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJza3kiLCJpZCI6ImFhYWEiLCJleHAiOjE2MTgxNDc4MDR9.Fc-cx3UNWnfoUArk5SZnKcu4XCi5FgmLOnGdNXk8M7U";
        String e1 = "1eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJza3kiLCJpZCI6ImFhYWEiLCJleHAiOjE2MTgxNDc4MDR9.Fc-cx3UNWnfoUArk5SZnKcu4XCi5FgmLOnGdNXk8M7U";
        String e2 = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.1eyJpc3MiOiJza3kiLCJpZCI6ImFhYWEiLCJleHAiOjE2MTgxNDc4MDR9.Fc-cx3UNWnfoUArk5SZnKcu4XCi5FgmLOnGdNXk8M7U";
        String e3 = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJza3kiLCJpZCI6ImFhYWEiLCJleHAiOjE2MTgxNDc4MDR9.1Fc-cx3UNWnfoUArk5SZnKcu4XCi5FgmLOnGdNXk8M7U";
        // JwtUtils.verifyToken(e1); // com.auth0.jwt.exceptions.JWTDecodeException: The input is not a valid base 64 encoded string.
        // JwtUtils.verifyToken(e2); // com.auth0.jwt.exceptions.JWTDecodeException: The input is not a valid base 64 encoded string.
        JwtUtils.verifyToken(e3); // com.auth0.jwt.exceptions.SignatureVerificationException: The Token's Signature resulted invalid when verified using the Algorithm: HmacSHA256
        // JWTDecodeException: The input is not a valid base 64 encoded string.
        String token2 = "eyJ0eXAxiOiJKVx1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJza3kiLCJpZCI6ImFhYWEiLCJleHAiOjE2MTgxNDMzMTR9.iA6agTg8jTXTYeTpES5BSv0cetUoObPz1-K3Tlj73Mg";
        Map<String, String> res = JwtUtils.verifyToken(day1);
        System.out.println(res);
    }
}
